import request from '@/utils/request'

// 分页查询班级列表
export const listClazzs = (params) => {
  return request({
    url: '/clazzs',
    method: 'get',
    params
  })
}

// 查询所有班级
export const listAllClazzs = () => {
  return request({
    url: '/clazzs/list',
    method: 'get'
  })
}

// 添加班级
export const addClazz = (data) => {
  return request({
    url: '/clazzs',
    method: 'post',
    data
  })
}

// 修改班级
export const updateClazz = (data) => {
  return request({
    url: '/clazzs',
    method: 'put',
    data
  })
}

// 删除班级
export const deleteClazz = (id) => {
  return request({
    url: `/clazzs/${id}`,
    method: 'delete'
  })
}

// 根据ID查询班级详情
export const getClazzById = (id) => {
  return request({
    url: `/clazzs/${id}`,
    method: 'get'
  })
}
